home *** CD-ROM | disk | FTP | other *** search
-
-
-
- DDDDIIIIRRRR((((4444)))) DDDDIIIIRRRR((((4444))))
-
-
-
- NNNNAAAAMMMMEEEE
- dir - format of EFS directories
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ffffssss////eeeeffffssss____ddddiiiirrrr....hhhh>>>>
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- A directory behaves exactly like an ordinary file, save that no user may
- write into a directory. The fact that a file is a directory is indicated
- by a bit in the flag word of its i-node entry [see _i_n_o_d_e(4)]. The EFS
- directory format supports variable length names of up to 255 characters.
-
- DDDDIIIIRRRREEEECCCCTTTTOOOORRRRYYYY BBBBLLLLOOOOCCCCKKKKSSSS
- Each EFS directory is segmented into directory blocks defined by the
- following data structure:
-
- #define EFS_DIRBLK_HEADERSIZE 4
- struct efs_dirblk {
- /* begin header */
- ushort magic;
- unchar firstused;
- unchar slots;
- /* end header */
-
- /* rest is space for efs_dent's */
- unchar space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
- };
-
- Each directory block is subdivided into three separate areas: a header,
- an array of entry offsets and an array of directory entries. The system
- restricts directory entries to short boundaries and stores offsets in the
- directory block compacted by shifting them right by one.
-
- The header area contains a _m_a_g_i_c number to identify the block as being a
- directory block. If the _m_a_g_i_c number is incorrect, the operating system
- will refuse to manipulate the directory, thus avoiding further
- corruption.
-
- The array of entry offsets immediately follows the header and is sized
- according to the directories contents and contains compacted offsets
- which point to each directory entry. The number of entry offsets
- available is kept in _s_l_o_t_s. The _f_i_r_s_t_u_s_e_d field contains a compacted
- offset which positions the first byte of the directory entries.
-
- The space between the end of the entry array and the beginning of the
- directory entries (_f_i_r_s_t_u_s_e_d) is free space which the system uses for
- allocating new directory entries and entry offsets. The system keeps the
- free space in a directory block compacted by coalescing holes created by
- entry removal. When a directory entry is removed, the system adjusts the
- entry offsets for all entries that move. Also, the entry offset for the
- removed entry is zeroed. If the removed entry was the last in the entry
- offset array, the number of _s_l_o_t_s is reduced. Directory entries never
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- DDDDIIIIRRRR((((4444)))) DDDDIIIIRRRR((((4444))))
-
-
-
- change which entry offset they use.
-
- DDDDIIIIRRRREEEECCCCTTTTOOOORRRRYYYY EEEENNNNTTTTRRRRIIIIEEEESSSS
- Directory entries have the following structure:
-
- struct efs_dent {
- union {
- ulong l;
- ushorts[2];
- } ud_inum;
- unchar d_namelen;
- char d_name[3];
- };
-
- The _d__n_a_m_e field is actually of variable size, depending upon the value
- contained in _d__n_a_m_e_l_e_n. The system pads out the directory entry to
- insure that it begins on a short boundary in the directory block. The
- _u_d__i_n_u_m field contains the entries inode number.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- fs(4), inode(4).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-